package com.stylefeng.guns.modular.pay.dao;

import java.math.BigDecimal;
import java.util.List;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.stylefeng.guns.modular.pay.dto.TransDTO;
import com.stylefeng.guns.modular.pay.dto.TransParams;
import com.stylefeng.guns.modular.pay.model.Trans;

/**
 * <p>
 * 佳付通流水表 Mapper 接口
 * </p>
 *
 * @author stylefeng
 * @since 2018-08-17
 */
public interface TransMapper extends BaseMapper<Trans> {

	List<Trans> list(@Param("page")Page<Trans> page, @Param("obj")TransParams trans);

	List<TransDTO> getExportData(TransParams param);
	
	@Select("SELECT IFNULL(sum(order_amount) ,0) FROM pay_trans where mch_no=#{memberNo} and tran_status in(0,1)")
	BigDecimal sumDailyAmount(String memberNo);

}
